﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Windows;
using System.Windows.Data;

namespace Microsoft.Samples.Office.UnifiedCommunications.Gadget
{
    public class IsEmptyFav5ContactIDConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string _value = value as string;

            if (_value == null || _value == String.Empty)
            {
                return Application.Current.FindResource("emptyFav5ContactIDStyle") as Style;
            }
            else
            {
                // TODO - 
                Fav5Config fav5Config = new Fav5Config();
                return fav5Config.Resources.FindName("textBoxStyleFav5") as Style;
                //return Application.Current.Resources.FindName("textBoxStyleFav5") as Style;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new Exception("The method or operation is not implemented.");
        }
    }

    public class IsEmptyFav5DisplayNameConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string _value = value as string;

            if (_value == null || _value == String.Empty)
            {
                return Application.Current.FindResource("emptyFav5DisplayNameStyle") as Style;
            }
            else
            {
                // TODO - 
                Fav5Config fav5Config = new Fav5Config();
                return fav5Config.Resources.FindName("textBoxStyleFav5") as Style;
                //return Application.Current.Resources.FindName("textBoxStyleFav5") as Style;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new Exception("The method or operation is not implemented.");
        }
    }
}
